#include "Utility.h"

Utility::Utility()
{
}

void Utility::drawTxt(Ogre::String tName, Ogre::UTFString tText, Ogre::SceneNode *tNode, Ogre::Real tSize , Ogre::Real tHeight)
{
	MovableText* msg = new MovableText(tName, tText);
	msg->setFontName("Arial");
	msg->setTextAlignment(MovableText::H_CENTER, MovableText::V_ABOVE);
	msg->showOnTop(true);
	msg->setAdditionalHeight( tHeight );
	msg->setCharacterHeight(tSize);
	tNode->attachObject(msg);
	
}

Ogre::UTFString Utility::ConvertToUTF(Ogre::String String)
{
   Ogre::UTFString UTFString;
   int i;
   Ogre::UTFString::code_point cp;
   for (i=0; i<(int)String.size(); ++i)
   {
      cp = String[i];
      cp &= 0xFF;
      UTFString.append(1, cp);
   }
   return UTFString;
} 